package designmode.headfirst.strategy;

import designmode.headfirst.strategy.action.fly.FlyWithRocket;
import designmode.headfirst.strategy.duck.BaseDuck;
import designmode.headfirst.strategy.duck.DuckWithGaoYou;
import designmode.headfirst.strategy.duck.DuckWithWood;

/**
 * 策略模式
 * <p>Filename: dp.headFirst.策略模式.Main.java</p>
 * <p>Date: 2020-09-24 17:40.</p>
 *
 * @author <a href="mailto:liufuguo@qianmi.com">OF3581-刘富国</a>
 * @version 0.1.0
 */
public class Main {

    public static void main(String[] args) {
        BaseDuck wood = new DuckWithWood();
        wood.introduce();
        wood.execEat();
        wood.execFly();
        wood.setFlyAction(new FlyWithRocket());
        wood.execFly();

        System.out.println();
        BaseDuck gaoYou = new DuckWithGaoYou();
        gaoYou.introduce();
        gaoYou.execEat();
        gaoYou.execFly();


    }
}
